from django.conf.urls import url
from crm.views import auth, consultant, teacher

urlpatterns = [
    url(r'^login/', auth.login, name='login'),
    url(r'^reg/', auth.reg, name='reg'),
    # 公户
    url(r'^customer_list/', consultant.CustomerList.as_view(), name='customer_list'),
    # 私户
    url(r'^my_customer/', consultant.CustomerList.as_view(), name='my_customer'),
    #
    # # 增加客户
    # url(r'^customer_add/', consultant.customer_add, name='customer_add'),
    # # 编辑客户
    # url(r'^customer_edit/(\d+)/', consultant.customer_edit, name='customer_edit'),

    # 增加客户
    url(r'^customer_add/', consultant.customer_change, name='customer_add'),
    # 编辑客户
    url(r'^customer_edit/(\d+)/', consultant.customer_change, name='customer_edit'),

    # 展示当前用户的所有的跟进记录
    url(r'^consult_record_list/', consultant.ConsultRecordList.as_view(), name='consult_record_list'),

    # 展示当前用户的所有的跟进记录
    url(r'^one_customer_record_list/(?P<customer_id>\d+)', consultant.ConsultRecordList.as_view(),
        name='one_customer_record_list'),

    # 增加跟进记录
    url(r'^consult_record_add/', consultant.consult_record_change, name='consult_record_add'),
    # 编辑跟进记录
    url(r'^consult_record_edit/(\d+)/', consultant.consult_record_change, name='consult_record_edit'),

    # 展示当前用户的所有的报名表
    url(r'enrollment_list/$', consultant.EnrollmentList.as_view(), name='enrollment_list'),

    # 展示当前用户的所有的跟进记录
    url(r'^one_enrollment_list/(?P<customer_id>\d+)/', consultant.EnrollmentList.as_view(),
        name='one_enrollment_list'),

    # 增加报名表
    url(r'^enrollment_add/(?P<customer_id>\d+)/', consultant.enrollment_change, name='enrollment_add'),
    # 编辑报名表
    url(r'^enrollment_edit/(?P<pk>\d+)/', consultant.enrollment_change, name='enrollment_edit'),

    # url(r'^user_list/', consultant.user_list, name='user_list'),

    # 展示班级信息
    url(r'class_list/$', teacher.ClassList.as_view(), name='class_list'),

    # 增加班级
    url(r'^class_add/', teacher.class_change, name='class_add'),
    # 编辑班级
    url(r'^class_edit/(?P<pk>\d+)/', teacher.class_change, name='class_edit'),

    # 展示课程记录
    url(r'course_record_list/(?P<class_id>\d+)$', teacher.CourseRecordList.as_view(), name='course_record_list'),

    # 增加课程记录
    url(r'^course_record_add/(?P<class_id>\d+)', teacher.course_record_change, name='course_record_add'),
    # 编辑课程记录
    url(r'^course_record_edit/(?P<pk>\d+)/', teacher.course_record_change, name='course_record_edit'),


    # 展示和编辑学习记录
    url(r'^study_record/(?P<course_record_id>\d+)/', teacher.study_record, name='study_record'),

]
